//
//  ThreePhotoTableViewCell.m
//  11_Work
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "ThreePhotoTableViewCell.h"
#import "ThreePhoto.h"

@interface ThreePhotoTableViewCell ()
@property (nonatomic, strong) UIImageView *leftImageView;
@property (nonatomic, strong) UIImageView *midImageView;
@property (nonatomic, strong) UIImageView *rightImageView;

@end

@implementation ThreePhotoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _leftImageView = [[UIImageView alloc] init];
        _leftImageView.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_leftImageView];
        
        _midImageView = [[UIImageView alloc] init];
        _midImageView.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_midImageView];

        _rightImageView = [[UIImageView alloc] init];
        _rightImageView.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:_rightImageView];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _leftImageView.frame = CGRectMake(0, 0, self.contentView.frame.size.width / 3, self.contentView.frame.size.height);
    _midImageView.frame = CGRectMake(self.contentView.frame.size.width / 3, 0, self.contentView.frame.size.width / 3, self.contentView.frame.size.height);
    _rightImageView.frame = CGRectMake(self.contentView.frame.size.width / 3 * 2, 0, self.contentView.frame.size.width / 3, self.contentView.frame.size.height);
}

- (void)setThreePhoto:(ThreePhoto *)threePhoto {
    _leftImageView.image = [UIImage imageNamed:threePhoto.leftImage];
    _midImageView.image = [UIImage imageNamed:threePhoto.midImage];
    _rightImageView.image = [UIImage imageNamed:threePhoto.rightImage];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
